UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RpnVabOB3B4RWEMHl2jGR69eiv7kjFzA3OC7uDgFwtY=' 
WHERE 
  key_id = '3f3a5172d77cb625c7d7d7b67729d05f329b5ffe3208d7662cf589584171509a' 
  AND (
    token = 'RpnVabOB3B4RWEMHl2jGR69eiv7kjFzA3OC7uDgFwtY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046