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

Query time 0.00018