UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lpoq6FU7mx+wuxu7R0tl07Cq/nCOVfNcJ5KE+J3eXQc='
WHERE
key_id = '1f87a130b458e038f844da8c1dbf05c7d7ca2ece061f94f367ce6c01efa0581c'
AND (
token = 'Lpoq6FU7mx+wuxu7R0tl07Cq/nCOVfNcJ5KE+J3eXQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)