UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wym7bAx7AKUNDiQNwX9hcN8AmeG5ZhUyZhm7C7iiIok='
WHERE
key_id = '1f339ddb18450dae6ee7a01f68dfbfbcce03ea98d74e87d5bc76b9cdb2497683'
AND (
token = 'Wym7bAx7AKUNDiQNwX9hcN8AmeG5ZhUyZhm7C7iiIok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)