UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TOTJfjDuR0N8NBXCFyU55P1L/p16xUUA4ZKLiLk1inE=' 
WHERE 
  key_id = '0c6fe1ed397e8984f1b4e65630a1352018e9cb0b5c3a500772566ed5f92fadaa' 
  AND (
    token = 'TOTJfjDuR0N8NBXCFyU55P1L/p16xUUA4ZKLiLk1inE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030