UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kGPxcVJ0mZCDIkgvmdQgUb4xpn7Og4aW20HKyJJ4rS4='
WHERE
key_id = '2eb072a7a6f9456eca5cba813b9e1505476e1b5b340ea8c6dafa31a69d056f87'
AND (
token = 'kGPxcVJ0mZCDIkgvmdQgUb4xpn7Og4aW20HKyJJ4rS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)