UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j4lL2B1/jYOC89nl84r9su13xdljIF9D0UPqBRDCv/Q=' 
WHERE 
  key_id = '0716fac786fb9440ff375ec957b5b8d64f5502edb47562ecb954be873d9440dd' 
  AND (
    token = 'j4lL2B1/jYOC89nl84r9su13xdljIF9D0UPqBRDCv/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042