UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j8ni8ZCatDwlHPLE2FCbzpLSIXdSX/SP70KrB0Jm6E0=' 
WHERE 
  key_id = '8e068415d7293be5e3d2865f819915d8341d587a3647fbf357fa607baf41967c' 
  AND (
    token = 'j8ni8ZCatDwlHPLE2FCbzpLSIXdSX/SP70KrB0Jm6E0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039