UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x5Kp5IWr7GC7ZasuSzyLwlC5Mhs+pz3gQqDpRrsyuPE=' 
WHERE 
  key_id = 'ad853df82e10ef42fabb8bc3596ffc4571ebf56e20af0cf5a003327b0ce5296a' 
  AND (
    token = 'x5Kp5IWr7GC7ZasuSzyLwlC5Mhs+pz3gQqDpRrsyuPE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045