UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jKvY2mfwdzPsE08LmN+JuI0dQEd7Geuw87MjzBbuziM=' 
WHERE 
  key_id = 'ecdccc3888110f459d1bc3b3aa7505216568072fa9ddd420e770abb1aa7e0a4f' 
  AND (
    token = 'jKvY2mfwdzPsE08LmN+JuI0dQEd7Geuw87MjzBbuziM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034