UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'caD9LFWrwo38X8u3oveCpxZU9tUwDRH0s13LSCMLdVw='
WHERE
key_id = 'db6d6803216776edbde7e9edd0f8d8975714c12294099fc42178cae4211107da'
AND (
token = 'caD9LFWrwo38X8u3oveCpxZU9tUwDRH0s13LSCMLdVw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)