UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jr7tQewHhU2o5PJsO/YhpA28nA0x/1w/bbROCkfHnWg='
WHERE
key_id = '01ad420559808b89874ea4bfce9d11cf7287f619d0e2c8805cecc98d8a2e8d48'
AND (
token = 'Jr7tQewHhU2o5PJsO/YhpA28nA0x/1w/bbROCkfHnWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)