UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IjSUk0kWY3AkFgpoZnG9IgPdfmWl2c2tzxbVnw/TuHk='
WHERE
key_id = 'c5e9ca8336cb0488b75e9e4a96781daec2ab15d734668656a42cf84b2c1fad67'
AND (
token = 'IjSUk0kWY3AkFgpoZnG9IgPdfmWl2c2tzxbVnw/TuHk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)