UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jc5pSOWOGRVgATmNSU22LbXr9wrFHO6YuPS3ZZFyxD0=' 
WHERE 
  key_id = 'dc8bf8da3f42abb7ed99d2fcdba4ff968a9efddd13ccc6743239b48f12effbf4' 
  AND (
    token = 'Jc5pSOWOGRVgATmNSU22LbXr9wrFHO6YuPS3ZZFyxD0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033