UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZymXGRr/uPlQ9YIi0nNyYZ24F7XxB4Mso4BFNNzfQ5o=' 
WHERE 
  key_id = 'bd4d00e3e73db240212c09543da27a86c569272b14f04b3bcd4174b8ef3fa88c' 
  AND (
    token = 'ZymXGRr/uPlQ9YIi0nNyYZ24F7XxB4Mso4BFNNzfQ5o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034