UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ByxaxKVsIMsksVBow2BlXawuYKnR3LR/nsnuxIe7GB0='
WHERE
key_id = 'bde325f3fccb93ee1389e65f7ec1aaecdf702bd380245888480a7538ad3b90dd'
AND (
token = 'ByxaxKVsIMsksVBow2BlXawuYKnR3LR/nsnuxIe7GB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)