UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1bBciOwHEH0wUeg3S9hJUpP6CCm9KmP9qtHxEiuJmzc=' 
WHERE 
  key_id = 'ad0b6c6fd6f5cf6e99df3c416e5c16bae60d4e7f64655665663d7360254a7698' 
  AND (
    token = '1bBciOwHEH0wUeg3S9hJUpP6CCm9KmP9qtHxEiuJmzc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029