UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w3xvbQkRbUBFKht5RZXABBV0xHUd/zeBNR79xnFQdUM='
WHERE
key_id = 'b5f7a693c41aaa28ef38c18275dd718a3e9bd878913c99f2280b628bd4518d57'
AND (
token = 'w3xvbQkRbUBFKht5RZXABBV0xHUd/zeBNR79xnFQdUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)