UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ggEbwJgD30Q5VE3jfdceVk//+78mieeb9ssriY7FK9k=' 
WHERE 
  key_id = 'da262c952526c2cd17364fafa9c0fd1f95b6a0b3e900866cdbc75f54794a3843' 
  AND (
    token = 'ggEbwJgD30Q5VE3jfdceVk//+78mieeb9ssriY7FK9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00093