UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wLYKVMjZY3AC8TXyKe3Hun9fheMD5uEYRCKs/pmmKaE='
WHERE
key_id = 'b6908865ceb39adf6302e5b44712ecb2f445c7e6966f36c49f2f42e0f077b301'
AND (
token = 'wLYKVMjZY3AC8TXyKe3Hun9fheMD5uEYRCKs/pmmKaE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)