UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k6mU/k/p3aSbO4mmuRfmALKvTIFXa4d35c/+qpFRJlI='
WHERE
key_id = '79665e960e180e953f892e528efcdabbda3aa74b3f74a64271e0aa4ddd8693c4'
AND (
token = 'k6mU/k/p3aSbO4mmuRfmALKvTIFXa4d35c/+qpFRJlI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)