UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H/+4+hTZYYkUaXjTSb1xyanpDn375QwIhY0kqSmEhnE='
WHERE
key_id = '34cd25c349b20a3037387e34c9bc5c879ee2a28b74f1c4de6ff3984f2317c902'
AND (
token = 'H/+4+hTZYYkUaXjTSb1xyanpDn375QwIhY0kqSmEhnE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)