UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZRWyuMOARHl/W4kk4LwvZe3+FZaSNQS7GSV0WQCJlsE='
WHERE
key_id = 'ee46466b59ab2db0827c08b21719bf7c851f7c79cb5eb2966ef9d67d2ae703fc'
AND (
token = 'ZRWyuMOARHl/W4kk4LwvZe3+FZaSNQS7GSV0WQCJlsE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)