UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2a+exG8neyyHoYvxK7aSqlTN1OJvsXzzp4x4ukRd9HA=' 
WHERE 
  key_id = '28ddcb2221ae486efbad4230942c410f13b2e35991f30821e480542d9ee2cbdf' 
  AND (
    token = '2a+exG8neyyHoYvxK7aSqlTN1OJvsXzzp4x4ukRd9HA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024