UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '30CaNjdj6MEfdyW5Neu2QNqVP+GLI71k2i2cXLS1qIM=' 
WHERE 
  key_id = '27fc79606d7373601274ed041ed94e98095e90ef2dc6f343a9179afe1f8e1568' 
  AND (
    token = '30CaNjdj6MEfdyW5Neu2QNqVP+GLI71k2i2cXLS1qIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021