UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+chcQxUuQelWp3iXaZmP5hTlEvcfCr2tiy80bYPInJA='
WHERE
key_id = 'fd7bee034e0151571fa96ce4ee2602a7ce4b5ddbe3e97424a04eaf0c38230cd0'
AND (
token = '+chcQxUuQelWp3iXaZmP5hTlEvcfCr2tiy80bYPInJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)