UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NaXK24pZup9aUiwRnBdUWXvb2x/1PhIl0QXx+CI4jFY=' 
WHERE 
  key_id = '6d6ac1a511c69e3757390b4bac5f17b32f103f58eaef0810bc34cdd21ff3105b' 
  AND (
    token = 'NaXK24pZup9aUiwRnBdUWXvb2x/1PhIl0QXx+CI4jFY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032