UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jnm6GIqjN/EKmGiNJ+9VG6TSrGF8KjwqWROzSlATSyM=' 
WHERE 
  key_id = 'd20a57ac416fe490cd7bc03bdf3430b526e51112f79bf146d73b88aa6079963c' 
  AND (
    token = 'jnm6GIqjN/EKmGiNJ+9VG6TSrGF8KjwqWROzSlATSyM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038