UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+b8ex67Nk0q5XB+cjUjW0DYW6+V7LOoUqSu3FgryyHU='
WHERE
key_id = 'b22aa6bbb9be9d6369d7af625f473b26610de27439a7cc3a6443a316a869191b'
AND (
token = '+b8ex67Nk0q5XB+cjUjW0DYW6+V7LOoUqSu3FgryyHU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)