UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ZZy7rsuEmbAj/znSebozNsls/OjdeETk1ruqJ4KeSk='
WHERE
key_id = '4ab18734144b01096b02e18263d2c05a5bad7d6cab440b57f51152146b12e890'
AND (
token = '4ZZy7rsuEmbAj/znSebozNsls/OjdeETk1ruqJ4KeSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)