UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ByyGq7u1nt+I9s4F2zI5aKFCed0DWxLFpv0fFf4DFSU='
WHERE
key_id = '4a36a8ce9632814fbc5f2ea0350a842af356eaf7dc967477c54be08418fd57b3'
AND (
token = 'ByyGq7u1nt+I9s4F2zI5aKFCed0DWxLFpv0fFf4DFSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)