UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rKoPnbPYpvKwfxXL4VEsQRQ9Cu2GeZdsLR0/uHwdi9g='
WHERE
key_id = '66a0265d42c1be1655ad168b7b31acc6b6d66291c03be21a59a83a0649ff6aad'
AND (
token = 'rKoPnbPYpvKwfxXL4VEsQRQ9Cu2GeZdsLR0/uHwdi9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)