UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UwFr01YsFI/Yc3ZLKsdSmF5HsE58RxP6u0jGbLki2R0='
WHERE
key_id = '69d36627edc2e2aa75030eeaeb42e796aa63e8777ae36fafd1c173f22e000618'
AND (
token = 'UwFr01YsFI/Yc3ZLKsdSmF5HsE58RxP6u0jGbLki2R0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)