UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0cdRE/KF+ztWQWd1zBeFIodfX3u+wzCgbBZ1kek5hPk=' 
WHERE 
  key_id = '0242695611886f79333f1ad7ed7823e988aa2329589b02f0a47cd63b09e1444a' 
  AND (
    token = '0cdRE/KF+ztWQWd1zBeFIodfX3u+wzCgbBZ1kek5hPk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023