UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1ZEn6WM0uq5pSznMHMhn4E+UaA3ERQ+D9VU9URL0aWo='
WHERE
key_id = '8cdbfee177048822d4ba1577d488aed3d0b6f84edd1184669787e052f2dcde7c'
AND (
token = '1ZEn6WM0uq5pSznMHMhn4E+UaA3ERQ+D9VU9URL0aWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)