UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KHpxeSwCeZkIHuxzpoOfPfEWAgL72cRUVKn5mT/Oic0='
WHERE
key_id = 'acb0d618cc015620d6d005bf0890ae1603023e08002460966ca99ee18cf147b7'
AND (
token = 'KHpxeSwCeZkIHuxzpoOfPfEWAgL72cRUVKn5mT/Oic0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)