UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fp55SCP/FbNaCrRvcVcfbvu6zGe4USGXU07VHjwwdKo='
WHERE
key_id = '59d018b73ee3d423b67fdeed36ca265a34760040ff2e9de605b155643758b5ef'
AND (
token = 'fp55SCP/FbNaCrRvcVcfbvu6zGe4USGXU07VHjwwdKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)