UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JeddGGqmIO51MKkcPqMe3mZ4ed0Mhpq8NHj5+yK55g0=' 
WHERE 
  key_id = '9b465fbda666f461c94287227325cd6b227ea657f82f44d395dd1e7f113131ac' 
  AND (
    token = 'JeddGGqmIO51MKkcPqMe3mZ4ed0Mhpq8NHj5+yK55g0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020