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