UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u5/pKy5IvWKCxUKXGoqYS8W8JqXSCWluO4hDi5wh/cI='
WHERE
key_id = '8fdc84278012759a8cac5211e9e18f151c3c0f7003b676a864cdd6d3b7017485'
AND (
token = 'u5/pKy5IvWKCxUKXGoqYS8W8JqXSCWluO4hDi5wh/cI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)