UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JbnWikeX/XpjxNYI3nnPcbtGclT2QqcmjO2WL8iJ7Qo='
WHERE
key_id = '665735b5ab3b59a7328d644c47042a92cbe59a4c76667c6e4a75cab28da8646a'
AND (
token = 'JbnWikeX/XpjxNYI3nnPcbtGclT2QqcmjO2WL8iJ7Qo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)