UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TafikOiCTTtNW3SwELG+ed28VnMFpICTgeRbuD2vn5Y=' 
WHERE 
  key_id = '616caa16ecebe91a6e074716b398b15a07ec27884ef5f1c0fd47f2ddf9d72d59' 
  AND (
    token = 'TafikOiCTTtNW3SwELG+ed28VnMFpICTgeRbuD2vn5Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037