UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rJ3zcGQB9CB6ktxPc29M9ePeMyDsT/VVHHhnjD4JZjo=' 
WHERE 
  key_id = '9f2b9a7c02e98f045d20958f7601839c53b7629afd080c68355554b7804ed880' 
  AND (
    token = 'rJ3zcGQB9CB6ktxPc29M9ePeMyDsT/VVHHhnjD4JZjo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035